home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
compuserve-file-archive
/
09 Application Software
/
GC1.SDA
/
CHECK LOC FILES
(
.txt
)
next >
Wrap
Commodore BASIC
|
2019-04-13
|
3KB
|
126 lines
10 E1$="LOCATION-NAME LENGTH ERROR"
20 E2$="OUT OF SEQUENCE"
30 E3$="LONGITUDE-FIELD LENGTH ERROR"
40 E4$="ILLEGAL CHARACTERS IN NAME FIELD"
50 E5$="ILLEGAL CHARACTERS IN LATITUDE FIELD"
60 E6$="ILLEGAL CHARACTERS IN LONGITUDE FIELD"
70 E7$="DUPLICATE ENTRY"
80 E8$="ERROR IN POINTER RECORD"
90 DN=PEEK(186)
100 REM -------1 = LENGTH ERROR NAME (1)
110 REM ------1- = SEQUENCE ERROR (2)
120 REM -----1-- = NAME NOT LEFT-JUSTIFIED (4)
130 REM ----1--- = ILLEGAL CHARACTERS NAME (8)
140 REM ---1---- = ILLEGAL CHARACTERS LATITUDE (16)
150 REM --1----- = ILLEGAL CHARACTERS LONGITUDE (32)
160 REM -1------ = DUPLICATION (64)
170 REM 1------- = ERROR IN POINTER RECORD (128)
180 PRINT"[147]PUT DISK IN DRIVE"DN
190 PRINT" AND PRESS A KEY"
200 POKE198,0:WAIT198,1
210 NF$=" "
220 OPEN15,DN,15,"I0"
230 OPEN1,4,7:POKE53281,1:POKE53280,7:POKE646,0
240 PRINT"[147] CHECK LATITUDE/LONGITUDE FILES"
250 PRINT""
260 FORI=65TO90
270 CLOSE8:OPEN8,DN,8,CHR$(I)
280 RN=1:GOSUB1040:GOSUB1040:GOSUB1120:INPUT#8,MN$:MN=VAL(MN$)
290 IFMN=1THEN980
300 RN=MN:GOSUB1040:GOSUB1040:GOSUB1120
310 IFEN<>50THENINPUT#8,PL$,LA$,LO$
320 IFEN=50ORPL$>"ZZZ"THENEV=EVOR128:PRINT#1,"FILE: "CHR$(I):GOSUB1160
330 CS$="":FORRN=2TOMN
340 GOSUB1040:GOSUB1040:GOSUB1120
350 EV=0:IFEN=50THENRN=MN:GOTO960
360 INPUT#8,PL$,LA$,LO$
370 IFPL$>"Z"THEN960
380 PRINTPL$"[145]"
390 :
400 :
410 REM ****CHECK NAME FIELD
420 REM FOR LENGTH
430 IFLEN(PL$)<>30THENEV=EV OR 1
440 IFLEFT$(PL$,1)=" "THEN EV=EV OR 4
450 FORK=1TOLEN(PL$)
460 CC$=MID$(PL$,K,1)
470 IFCC$=" "THEN550
480 IFCC$>"@"ANDCC$<"["THEN550
490 IFCC$="-"THEN550
500 IFCC$="'"THEN550
510 IFCC$=")"THEN550
520 IFCC$="("THEN550
530 IFCC$="."THEN550
540 EV=EV OR 8
550 NEXT
560 :
570 :
580 REM ****CHECK LATITUDE FIELD
590 REM
600 TV=VAL(LA$)
610 LA$=STR$(TV)
620 IFTV=0 OR TV>90 OR TV<-90THEN EV=EV OR 16
630 FORK=1TOLEN(LA$)
640 CC$=MID$(LA$,K,1)
650 IFCC$>"/"ANDCC$<":"THEN710
660 IFCC$=" "THEN710
670 IFCC$="-"THEN710
680 IFCC$="."THEN710
690 IFCC$="E"THEN710
700 EV=EV OR 16
710 NEXT
720 :
730 :
740 REM ****CHECK LONGITUDE FIELD
750 REM
760 TV=VAL(LO$):LO$=STR$(TV)
770 IF TV=0 OR TV>179.9999999 OR TV<-179.999999 THEN EV=EV OR 32
780 FORK=1TOLEN(LO$)
790 CC$=MID$(LO$,K,1)
800 IFCC$>"/"ANDCC$<":"THEN860
810 IFCC$=" "THEN860
820 IFCC$="-"THEN860
830 IFCC$="."THEN860
840 IFCC$="E"THEN860
850 EV=EV OR 32
860 NEXT
870 :
880 :
890 REM ***CHECK FOR DUPLICATIONS OR
900 REM SEQUENCE ERRORS
910 REM
920 IFPL$=CS$THENEV= EV OR 64
930 IFPL$<CS$THENEV= EV OR 2
940 IFEV<>0THENGOSUB1160
950 CS$=PL$
960 NEXT
970 CLOSE8
980 NEXT
990 PRINT" "
1000 FORI=1TO15:CLOSEI:NEXT:POKE186,8:LOAD"MENU",DN
1010 :
1020 :
1030 REM\ POSITION & ERROR SUB
1040 RH=INT(RN/256):RL=RN-(256*RH)
1050 PRINT#15,"P"+CHR$(96+8)+CHR$(RL)+CHR$(RH)+CHR$(1)
1060 INPUT#15,EN,EM$,ET,ES
1070 IF EN=0OREN=50THENRETURN
1080 PRINTEN;EM$;ET;ES
1090 CLOSE8:CLOSE15:STOP
1100 :
1110 :
1120 IFPEEK(52)<PEEK(50)+3THENYY=FRE(0)
1130 RETURN
1140 :
1150 :
1160 PRINT#1,PL$:PRINT"ERROR: "PL$"[144]"
1170 IF(EV AND 1)<>0THENPRINT#1,NF$E1$
1180 IF(EV AND 2)<>0THENPRINT#1,NF$E2$
1190 IF(EV AND 4)<>0THENPRINT#1,NF$E3$
1200 IF(EV AND 8)<>0THENPRINT#1,NF$E4$
1210 IF(EV AND 16)<>0THENPRINT#1,NF$E5$
1220 IF(EV AND 32)<>0THENPRINT#1,NF$E6$
1230 IF(EV AND 64)<>0THENPRINT#1,NF$E7$
1240 IF(EV AND 128)<>0THENPRINT#1,NF$E8$
1250 RETURN